home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / c / tclib20.zip / DEMO.ZIP / DEMOLITE.C < prev    next >
C/C++ Source or Header  |  1988-12-03  |  2KB  |  49 lines

  1. /* demolite.c  - used for testing TCHK litebar menus */
  2.  
  3. #include <menuhk.h>
  4. #include <video.h>
  5. #include <color.h>
  6. #include <howard.h>
  7. #include <stdio.h>
  8. #include <string.h>
  9. #include <keycode.h>
  10. /*
  11. coords        1        2        3         4          cmd #
  12.     0    5    0    5   0    5   0    5    0
  13.      Dial    Add   moVe                             0  2  4
  14.      Manual  Edit  Kill                             1  3  5
  15. */
  16.  
  17. void main()
  18. {
  19.     extern int _argc, litebarerrno;
  20.     char *cmd[]={" Dial ", " Manual ", " Add ", " Edit ", " moVe ", " Kill "};
  21.     char cmdflag[] = { 0,0,0,0,0,0 };
  22.     char *msg[] = { NULL, NULL, NULL, NULL, NULL, NULL };
  23.     int cmdx[] = { 0, 0, 8, 8,14,14};
  24.     int cmdy[] = { 0, 1, 0, 1, 0, 1 };
  25.     int cmdleft[] = { 4, 5, 0, 1, 2, 3 };
  26.     int cmdright[]= { 2, 3, 4, 5, 0, 1 };
  27.     int cmdup[] =   { 1, 0, 3, 2, 5, 4 };
  28.     int cmddown[] = { 1, 0, 3, 2, 5, 4 };
  29.     int k, cmdkey[] = { 1, 1, 1, 1, 3, 1 };
  30.     int argq[] = { ALT_Q };
  31.     struct litebar_header *lh;
  32.  
  33.     lh = litebar_alloc(1,10,80,11,NULL,NULL,NONE,6,cmd,cmdleft,cmdright,
  34.                        cmdup,cmddown,cmdkey,cmdflag,cmdx,cmdy,msg,1,1,1,
  35.                        argq, BLACK, BLACK, YELLOW, LRED, LBLUE|B_WHITE,
  36.                        CYAN, BLACK|B_CYAN, LGREEN, LWHITE|B_RED, 1,
  37.                        CASEINDEP|ERASEMENU|ESCQUIT|FREEMENU);
  38.     if (lh == NULL)
  39.         printf("lh == NULL\n");
  40.     else {
  41.         cls();
  42.         do {
  43.             k = litebar_get(lh);
  44.             gotohv(60,22);
  45.             printf("k = %4d",k);
  46.         } while (k != 0);
  47.     }           /* note: litebar_free() not needed because of FREEMENU flag */
  48. }
  49.